const mysql = require('mysql')

const db = mysql.createPool({
    host: '124.223.81.198',
    user: 'constown',
    password: 'wobuzhidao',
    database: 'tuziya'
})

// 检测数据库是否连接成功
db.query("select 1", (err, results) => {
  if (err) return console.log(err);
  console.log(results);
});
//如果能打印出[ RowDataPacket { '1': 1 } ]代表连接数据库成功


module.exports = db
